package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TbVehicleIllegal;
import com.ruoyi.system.mapper.TbVehicleIllegalMapper;
import com.ruoyi.system.service.ITbVehicleIllegalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车辆违章Service业务层处理
 *
 * @author lxy
 * @date 2024-04-28
 */
@Service
public class TbVehicleIllegalServiceImpl implements ITbVehicleIllegalService {
    @Autowired
    private TbVehicleIllegalMapper tbVehicleIllegalMapper;

    /**
     * 查询车辆违章
     *
     * @param id 车辆违章主键
     * @return 车辆违章
     */
    @Override
    public TbVehicleIllegal selectTbVehicleIllegalById(Long id) {
        return tbVehicleIllegalMapper.selectTbVehicleIllegalById(id);
    }

    /**
     * 查询车辆违章列表
     *
     * @param tbVehicleIllegal 车辆违章
     * @return 车辆违章
     */
    @Override
    public List<TbVehicleIllegal> selectTbVehicleIllegalList(TbVehicleIllegal tbVehicleIllegal) {
        return tbVehicleIllegalMapper.selectTbVehicleIllegalList(tbVehicleIllegal);
    }

    /**
     * 新增车辆违章
     *
     * @param tbVehicleIllegal 车辆违章
     * @return 结果
     */
    @Override
    public int insertTbVehicleIllegal(TbVehicleIllegal tbVehicleIllegal) {
        tbVehicleIllegal.setCreateTime(DateUtils.getNowDate());
        return tbVehicleIllegalMapper.insertTbVehicleIllegal(tbVehicleIllegal);
    }

    /**
     * 修改车辆违章
     *
     * @param tbVehicleIllegal 车辆违章
     * @return 结果
     */
    @Override
    public int updateTbVehicleIllegal(TbVehicleIllegal tbVehicleIllegal) {
        tbVehicleIllegal.setUpdateTime(DateUtils.getNowDate());
        return tbVehicleIllegalMapper.updateTbVehicleIllegal(tbVehicleIllegal);
    }

    /**
     * 批量删除车辆违章
     *
     * @param ids 需要删除的车辆违章主键
     * @return 结果
     */
    @Override
    public int deleteTbVehicleIllegalByIds(Long[] ids) {
        return tbVehicleIllegalMapper.deleteTbVehicleIllegalByIds(ids);
    }

    /**
     * 删除车辆违章信息
     *
     * @param id 车辆违章主键
     * @return 结果
     */
    @Override
    public int deleteTbVehicleIllegalById(Long id) {
        return tbVehicleIllegalMapper.deleteTbVehicleIllegalById(id);
    }

    /**
     * 查询车辆违章列表(违章未处理)
     *
     * @param tbVehicleIllegal 车辆违章
     * @return 车辆违章集合
     */
    @Override
    public List<TbVehicleIllegal> selectTbVehicleIllegalOverspeed(TbVehicleIllegal tbVehicleIllegal)
    {
        return tbVehicleIllegalMapper.selectTbVehicleIllegalOverspeed(tbVehicleIllegal);
    }
}
